<style>
  .parent {
    width: 0;
    height: 0;
    top: 0;
    left: 0;
    position: absolute;
  }
  .child {
    position: absolute;
    width: 50px;
    height: 50px;
  }
</style>

<div class="parent">
  <button class="child">test</button>
</div>
